////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//                                                                                                                            //
//                                                         WNProject                                                          //
//                                                                                                                            //
//            This file is distributed under the BSD 2-Clause open source license. See License.txt for details.               //
//                                                                                                                            //
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

#ifndef __WN_PROCESSOR_INFO_H__
#define __WN_PROCESSOR_INFO_H__

#include "WNCore/inc/WNBase.h"

#ifdef _WN_CPLUSPLUS
    extern "C" {
#endif

#define WN_PROCESSOR_FEATURE_FPU                                1
#define WN_PROCESSOR_FEATURE_X86_CMPXCHG8B                      (1 << 1)
#define WN_PROCESSOR_FEATURE_X86_CMPXCHG16B                     (1 << 2)
#define WN_PROCESSOR_FEATURE_X86_MMX                            (1 << 3)
#define WN_PROCESSOR_FEATURE_X86_MMX_EXT                        (1 << 4)
#define WN_PROCESSOR_FEATURE_X86_3DNOW                          (1 << 5)
#define WN_PROCESSOR_FEATURE_X86_3DNOW_EXT                      (1 << 6)
#define WN_PROCESSOR_FEATURE_X86_SSE                            (1 << 7)
#define WN_PROCESSOR_FEATURE_X86_SSE2                           (1 << 8)
#define WN_PROCESSOR_FEATURE_X86_SSE3                           (1 << 9)
#define WN_PROCESSOR_FEATURE_X86_SSSE3                          (1 << 10)
#define WN_PROCESSOR_FEATURE_X86_SSE4_1                         (1 << 11)
#define WN_PROCESSOR_FEATURE_X86_SSE4_2                         (1 << 12)
#define WN_PROCESSOR_FEATURE_X86_SSE4A                          (1 << 13)
#define WN_PROCESSOR_FEATURE_X86_AVX                            (1 << 14)

#define WN_PROCESSOR_ENDIAN_LITTLE                              0x0F
#define WN_PROCESSOR_ENDIAN_BIG                                 0xF0

WN_UINT32 WNProcessorInfo_Features();
WN_BYTE   WNProcessorInfo_Endianness();
WN_UINT8  WNProcessorInfo_PhysicalCoreCount();
WN_UINT8  WNProcessorInfo_LogicalThreadCount();

#ifdef _WN_CPLUSPLUS
    }
#endif

#endif // __WN_PROCESSOR_INFO_H__